import request from '@/utils/request'

// 添加员工
export const addemp = (addfrom) => {
  return request.post('/admin/employee', addfrom)
}

// 分页查询
export const page = (name, page, pageSize) => {
  return request.get('/admin/employee/page', {
    params: {
      name,
      page,
      pageSize
    }
  })
}

// 根据ID查询员工
export const query = (id) => {
  return request.get(`/admin/employee/${id}`)
}

// 修改员工
export const update = (editFrom) => {
  return request.put('/admin/employee/update', editFrom)
}

// 启用禁用
export const statusEmp = (status, id) => {
  return request.post(`/admin/employee/status/${status}`, id)
}

// 根据id删除员工
export const deleteEmp = (id) => {
  return request.delete(`/admin/employee/${id}`)
}
